package com.micro.mic_common.other;

import com.micro.mic_common.enums.ResultEnums;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @Description
 * @Author yijian
 * @Date 2021/12/28 18:29
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResponseData<T> implements Serializable {

    private String code;
    private String msg;
    private T data;

    public ResponseData(String code,String msg){
        this.code=code;
        this.msg=msg;
    }

    public ResponseData(ResultEnums resultEnums){
        this.code = resultEnums.getCode();
        this.msg = resultEnums.getMsg();
    }

    public ResponseData(ResultEnums resultEnums,T data){
        this.code = resultEnums.getCode();
        this.msg = resultEnums.getMsg();
        this.data = data;
    }

}
